package com.jinkaimen.kqb.ui.holder;

import android.graphics.drawable.Drawable;
import android.widget.ImageView;
import android.widget.TextView;

import com.ht.baselibs.application.HTApplication;
import com.ht.baselibs.ui.base.BaseViewHolder;
import com.jinkaimen.kqb.R;
import com.jinkaimen.kqb.bean.HomeOpreratorBean;

public class HomeOperatorViewHolder extends BaseViewHolder<HomeOpreratorBean> {
    private TextView mTextView;
    private ImageView mImageView;

    public HomeOperatorViewHolder() {
        super(R.layout.list_home_operator_item);
    }

    @Override
    protected void initView() {
        mTextView = findViewById(R.id.tv_list_home_operator_item_title);
        mImageView = findViewById(R.id.iv_list_home_operator_item_title);
    }

    @Override
    protected void refreshView(HomeOpreratorBean homeOpreratorBean) {
        Drawable drawable= HTApplication.getContext().getResources().getDrawable(homeOpreratorBean.icon);
        drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
        mImageView.setImageDrawable(drawable);
        mTextView.setText(homeOpreratorBean.title);
    }
}
